<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link href="res/style.css" rel="stylesheet">
    <script src="http://47.106.66.89:8080/js/vue.min.js"></script>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
</head>
<body>
<div id="app" class="flex">
    <<main>
        <header class="flex">
            <div>
                <h3>源辰银行</h3>
                <small>ycinfo bank</small>
            </div>
            <div id="contact">
                <div>客服电话: 8888</div>
                <div>网址: www.ycinfo.bank.com</div>
            </div>
        </header>
        <div class="msg">
            倒计时: <h2>32</h2> 秒
        </div>
        <div id="pane" class="flex">
            <div class="btns">
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
            </div>
            <div id="info">
                <h2>请输入账号和密码</h2>
                <form action="main.html">
                    <input placeholder="账号" v-model="userId"><br>
                    <input placeholder="密码" type="password" v-model="password">
                </form>
            </div>
            <div class="btns">
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
                <a  class="right" @click="log()">确定</a>
                <a class="right">退出</a>
            </div>
        </div>
    </main>>
</div>
    <script>
        let app = new Vue({
            el:"#app",
            data: {
                userId:0,
                password:""
            },
            methods:{
                log(){
                    let p = new URLSearchParams();
                    p.append("userId",this.userId);
                    p.append("password",this.password);
                    axios.post(
                        "user/log",
                        p
                    ).then(resp=>{
                        if(resp.data > 0){
                            location.href ="main.html";
                        }else {
                            alert("账号或密码错误");
                        }
                    });
                }
            },
            created(){
            }
        });
    </script>
</body>
</html>
